<volist name="tree" id="list">
	<dl class="cate-item">
		<dt class="cf">
			<form action="{:U('edit')}" method="post">
				<div class="btn-toolbar opt-btn cf">
					<a title="编辑" href="{:U('edit?id='.$list['id'].'&pid='.$list['pid'])}">编辑</a>
					<a title="删除" href="{:U('remove?id='.$list['id'])}" class="confirm ajax-get">删除</a>
				</div>
				<div class="fold"><i></i></div>
				<div class="order"><input type="text" name="sort" class="text input-mini" value="{$list.sort}"></div>
				<div class="order">{$list['allow_publish']?'是':'否'}</div>
				<div class="name">
					<span class="tab-sign"></span>
					<input type="hidden" name="id" value="{$list.id}">
					<input type="text" name="title" class="text" value="{$list.title}" disabled>
					<a class="edit-position" title="修改职位" onclick="$(this).prev().attr('disabled',false);$(this).css('display','none');$(this).next().css('display','inline');" style="cursor:pointer;">
						<i class="black-color icon-edit"></i>
					</a>
					<a class="save-position confirm ajax-get" title="保存修改" style="display:none;" href="{:U('edit?id='.$list['id'])}">
						<i class="black-color icon-save"></i>
					</a>
			
					<a class="add-position" title="添加直属职位" href="{:U('add?pid='.$list['id'])}">
						<i class="black-color icon-plus-sign"></i>
					</a>
					<span class="help-inline msg"></span>
				</div>
			</form>

			
		</dt>
		<notempty name="list['_']">
			<dd>
				{:R('Category/tree', array($list['_']))}
			</dd>
		</notempty>
	</dl>
</volist>
<script>
$('.add-position').click(function(){
	var url = $(this).attr('data-href');
	var title = $('input[name=new_title]').val();
	$.post(url,{title:title},function(){
		var item = '<input type="text" name="new_title" class="text" value=""><a class="add-position" title="添加直属职位" href="'+'">	<i class="black-color icon-plus-sign"></i></a><span class="help-inline msg"></span>';	
		$(this).after(item);
	}
});
</script>